/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.ufrgs.inf.prav.jsf;

import br.ufrgs.inf.prav.jsf.components.ImgComponent;
import br.ufrgs.inf.prav.jsf.components.PravBaseComponent;
import javax.faces.component.UIComponent;
import javax.faces.webapp.UIComponentELTag;

/**
 *
 * @author Fernando Arena Varella
 * @version 1.0
 */
public abstract class PravBaseTag extends UIComponentELTag {

    //core attributes
    protected String styleClass, id, style, title;
    //language attributes
    protected String dir, lang;
    //keyboard attributes
    protected String accesskey,  tabindex;
    //specific attributes
    protected String value;
    protected boolean displayMobile = true, displayTv = true, displayWeb = true;

    public PravBaseTag(){

    }

    @Override
    public String getComponentType() {
        return PravBaseComponent.COMPONENT_TYPE;
    }

    @Override
    public String getRendererType() {
        return null;
    }

    @Override
    protected void setProperties(UIComponent component) {
        /* you have to call the super class */
        super.setProperties(component);
        PravBaseComponent baseComponent = (PravBaseComponent) component;
        baseComponent.setAccesskey(accesskey);
        baseComponent.setStyleClass(styleClass);
        baseComponent.setDir(dir);
        baseComponent.setId(id);
        baseComponent.setLang(lang);
        baseComponent.setStyle(style);
        baseComponent.setTabindex(tabindex);
        baseComponent.setTitle(title);

        baseComponent.setValue(value);

        baseComponent.setDisplayMobile(displayMobile);
        baseComponent.setDisplayTv(displayTv);
        baseComponent.setDisplayWeb(displayWeb);
    }

    // <editor-fold defaultstate="collapsed" desc="Getters And Setters">

    public String getAccesskey() {
        return accesskey;
    }

    public void setAccesskey(String accesskey) {
        this.accesskey = accesskey;
    }

    public String getStyleClass() {
        return styleClass;
    }

    public void setStyleClass(String styleClass) {
        this.styleClass = styleClass;
    }

    public String getDir() {
        return dir;
    }

    public void setDir(String dir) {
        this.dir = dir;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLang() {
        return lang;
    }

    public void setLang(String lang) {
        this.lang = lang;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public String getTabindex() {
        return tabindex;
    }

    public void setTabindex(String tabindex) {
        this.tabindex = tabindex;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    

    public boolean isDisplayMobile() {
        return displayMobile;
    }

    public void setDisplayMobile(boolean displayMobile) {
        this.displayMobile = displayMobile;
    }

    public boolean isDisplayTv() {
        return displayTv;
    }

    public void setDisplayTv(boolean displayTv) {
        this.displayTv = displayTv;
    }

    public boolean isDisplayWeb() {
        return displayWeb;
    }

    public void setDisplayWeb(boolean displayWeb) {
        this.displayWeb = displayWeb;
    }

    // </editor-fold>

}
